package stud.aistar.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import stud.aistar.entity.Doctor;
import stud.aistar.entity.SecondDepartment;
import stud.aistar.mapper.DoctorMapper;
import stud.aistar.service.IDoctorService;

import java.util.List;
import java.util.Map;

/**
 * Created by Jcdz on 2019/9/28.
 */
@Service
@Transactional
public class DoctorServiceImpl implements IDoctorService {

    @Autowired
    private DoctorMapper doctorMapper;

    @Override
    public List<Doctor> findAll() {
        return doctorMapper.findAll() ;
    }

    @Override
    public Doctor findById(Integer id) {
        return doctorMapper.findById(id);
    }

    @Override
    public List<Doctor> findBySdeptId(Integer id) {
        return doctorMapper.findBySdeptId(id);
    }

    @Override
    public String findNameById(Integer id) {
        return doctorMapper.findNameById(id);
    }

    @Override
    public Map<String, SecondDepartment> findNameAndSdeptNameById(Integer id) {
        return doctorMapper.findNameAndSdeptNameById(id);
    }

    @Override
    public Integer findDocTypeByDocName(String name) {
        return doctorMapper.findDocTypeByDocName(name);
    }
}
